package com.contractpage.ec.service.impl;


import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.contractpage.common.persistence.Page;
import com.contractpage.ec.dao.ResourceDao;
import com.contractpage.ec.service.ResourceService;
import com.contractpage.ec.entity.Resource;



/**
 * 
 * ResourceServiceImpl数据库操作接口类
 * 
 **/
@Transactional
@Service
public class ResourceServiceImpl implements ResourceService{
	@Autowired
	private ResourceDao resourceDao;
	@Override
	public Page<Resource> findList(Page<Resource> page,Resource entity){
		entity.setPage(page);
		page.setList(resourceDao.findList(entity));
		return page;
	}
	@Override
	public int insert(Resource entity){
		entity.preInsert("");
		return resourceDao.insert(entity);
	}
	@Override
	public int update(Resource entity){
		entity.preUpdate();
		return resourceDao.update(entity);
	}
	@Override
	public int delete(Resource entity){
		 return resourceDao.delete(entity);
	}
}